<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<%@ page import = "dataAccessObject.LibraryDao"%> 
<%@ page import = "javabean.ProgramBean"%>
<%@ page import = "java.util.*"%>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="style.css" rel="stylesheet" type="text/css" />
<title>Jedi Library</title>
</head>
<body>
	
	<div id = "header">
		<h1>Jedi Library</h1>
	</div>
	<hr />
	
	<div id = "menus">
		<h4>Main Menu:</h4>
		<ul id = "list-nav">
			<li><a href = "home.jsp">Home</a></li>
			<li><a href = "library.jsp">Library</a></li>
		</ul>		
	</div>
	
	<div id = "content2">
		<form>
		Program name:<input type = "text" name = "programName">
		<br>
		Program description:<input type = "text" name = "programDesc">
		</form>
		<button type = "button">Add new program</button>
		<button type = "button">delete program</button>
		<br>
		<br>
		
	
		<div id = "librarylist">
			<table>
				<tr>
					<th>Program list</th>
					<th>Program Description</th>
				</tr>
				<%
				
				LibraryDao dao = new LibraryDao();
				List<ProgramBean> programList = dao.getAllPrograms();
				
				for(ProgramBean prog: programList ){
				%>
				<tr>
					<td><%= prog.getProgramName()%></td>
					<td><%= prog.getProgramDesc()%></td>
				</tr>
				<%}%>
				
			</table>
		</div>
		
		
	</div>



</body>
</html>